﻿using System.Collections.Generic;

namespace Fly.Common.Email
{
    /// <summary>
    /// 提示信息
    /// </summary>
    public class NotificationMessage
    {
        #region 属性
        /// <summary>
        /// 收件人
        /// </summary>
        public string To { set; get; }
        /// <summary>
        /// 发件人
        /// </summary>
        public string From { set; get; }
        /// <summary>
        /// 抄送
        /// </summary>
        public string Subject { set; get; }
        /// <summary>
        /// 邮件正文
        /// </summary>
        public string Body { set; get; }
        /// <summary>
        /// 消息模板
        /// </summary>
        public string MessageTemplateId { set; get; }
        /// <summary>
        /// 是否是 HTML 邮件
        /// </summary>
        public bool IsHtml { set; get; }
        /// <summary>
        /// 其他字典
        /// </summary>
        public IDictionary<string, string> Values { set; get; } 
        #endregion

        /// <summary>
        /// 初始化.
        /// </summary>
        /// <param name="values"></param>
        /// <param name="to"></param>
        /// <param name="from"></param>
        /// <param name="subject"></param>
        /// <param name="messageTemplateId"></param>
        public NotificationMessage(IDictionary<string, string> values, string to, string from, string subject, string messageTemplateId)
        {
            To = to;
            From = from;
            Subject = subject;
            Values = values;
            MessageTemplateId = messageTemplateId;
            IsHtml = true;
        }
    }



    /// <summary>
    /// 邮件消息
    /// </summary>
    public class EmailMessage
    {

        /// <summary>
        /// From email address.
        /// </summary>
        public string From { get; set; }

        /// <summary>
        /// To email address.
        /// </summary>
        public string To { get; set; }

        /// <summary>
        /// Subject of email.
        /// </summary>
        public string Subject { get; set; }

        /// <summary>
        /// Body of email.
        /// </summary>
        public string Body { get; set; }
    }
}
